﻿<!DOCTYPE>
<html>
<head>
    <meta http-equiv="X-UA-Compatible" content="IE=EDGE;IE=11;IE=8,chrome=1" />
    <title>首件鉴定/质量评审/工艺评审</title>
    <link href="/InSiteWebApplication/Content/Easyui/themes/metro/easyui.css" rel="stylesheet" />
    <link href="/InSiteWebApplication/Content/Easyui/custom-easyui.css" rel="stylesheet" />
    <link href="/InSiteWebApplication/Content/Easyui/themes/icon.css" rel="stylesheet" />
     <style>
        .easyui-linkbutton{margin-left:20px;}
        table tr td{padding:0px 5px}
    </style>
</head>
<body>
    <div class="panelSection">    
        <div class="easyui-panel " title="查询区域" style="padding:3px;" data-options="closable:false,collapsible:true,minimizable:false,maximizable:false">
        <form id="searchForm">
               <table>
	    		    <tr  class="divLabel">
	    			    <td>件号:</td>
                        <td>件号名称:</td>
                        <td>类别:</td>
                        <td>状态:</td>
	    		    </tr>
	    		    <tr >
	    			    <td><input class="easyui-textbox" type="text" name="DrawingNo" style="width: 120px; height: 22px"/></td>
	    			    <td><input class="easyui-textbox" type="text" name="ProductName" style="width: 120px; height: 22px"/></td>
                        <td><input id="IdentifyType" name="IdentifyType" style="width: 120px; height: 22px"/></td>
                        <td><input id="Status" name="Status" style="width: 120px; height: 22px"/></td>
                        <td><a href="javascript:void(0)" class="easyui-linkbutton" onclick="page.searchData()">查询</a></td>
	    			    <td><a href="javascript:void(0)" class="easyui-linkbutton" onclick="page.searchReset()">重置</a></td>
	    		    </tr>
                </table>
        </form> 
        </div> 
    </div> 

<!--结果区域-->
     <div class="panelSection">    
        <div class="easyui-panel " title="任务单信息" style="padding:3px;" data-options="closable:false,collapsible:true,minimizable:false,maximizable:false"> 
            <div style="margin: 3px 0px 3px 3px">
                <table id="FirstIdentifyProduct" class="easyui-datagrid" style="width: 100%; height: 450px"data-options="rownumbers:true,pagination:false"></table>
                    <div id="pp" style="float: right" class="easyui-pagination" data-options="   
                 layout:['first','prev','next','last','manual','info'],              
                    total: 0,
                    showPageList: false,
                    showPageInfo: false,
                    showRefresh: false,
                    afterPageText:'共&nbsp{pages}&nbsp页',
                     buttons:[{
                            iconCls:'',
                            text:'Go',
                            id:'pageGo'
                    }]
                ">
                    </div>
            </div>
        </div>
    </div>
    <div class="panelSection">    
        <div class="easyui-panel " title="按钮区域" style="padding:3px;" 
        data-options="closable:false,collapsible:true,minimizable:false,maximizable:false"> 
             <a href="javascript:void(0)"  class="easyui-linkbutton" data-options="width:120" onclick="page.SecureFirstIdentifyProduct()" style="margin: 10px 0 10px 20px;">解除</a>
        </div>
    </div>
      <!--信息提示区域-->
     <div id="statusMessage" style="font-size: 14px; height: 40px"></div>
</body>
</html>
<script src="/InSiteWebApplication/Scripts/CustomPageJs/ReferenceJsLib.js" type="text/javascript"></script>
<script src="/InSiteWebApplication/Content/Easyui/jquery.min.js" type="text/javascript"></script>
<script src="/InSiteWebApplication/Content/Easyui/jquery.easyui.min.js" type="text/javascript"></script>
<script src="/InSiteWebApplication/Content/Easyui/easyui-lang-zh_CN.js" type="text/javascript"></script>
<script src="/InSiteWebApplication/Scripts/CustomPageJs/CustomCommon.js" type="text/javascript"></script>
<script  type="text/javascript">
/*
创建人：longb
日期：2023-05-05
描述：首件鉴定、质量评审、工艺评审目录
*/
    var page = {
        pagetotal: 0,
        pageSize: 20,
        pageNumber: 1,
        editIndex: null, //easyUI单元格编辑
        rootPath: getRootPath(), //网站根路径
        ajaxUrl: getRootPath() + "/Ashx/ZsHandler/ZSGJCheckSubmitBillHandler.ashx",
        //初始化页面
        init: function () {
            page.bind();
            customizedEasyuiPagination('pp'); //定制化分页
        },
        //页面事件绑定
        bind: function () {
            $('#Status').combobox({
                data: [{ id: '0', text: '未解除' }, { id: '1', text: '已解除' }, { id: '', text: '全部'}],
                valueField: 'id',
                textField: 'text',
                value: '0',
                panelHeight: 'auto'
            });
            $('#IdentifyType').combobox({
                data: [{ id: '1', text: '首件鉴定' }, { id: '2', text: '质量评审' }, { id: '3', text: '工艺评审' }, { id: '', text: '全部'}],
                valueField: 'id',
                textField: 'text',
                value: '',
                panelHeight: 'auto'
            });
            //任务单信息
            $("#FirstIdentifyProduct").datagrid({
                singleSelect: true,
                onLoadSuccess: function (data) {
                    $('#pp').pagination('refresh', {	// 改变选项，并刷新分页栏信息
                        total: page.pagetotal,
                        pageSize: page.pageSize,
                        pageNumber: page.pageNumber
                    });
                    customizedEasyuiPagination('pp'); //定制化分页
                },
                columns: [[
                 { field: 'ck', title: '选择', checkbox: true },
                 { field: 'DRAWINGNO', title: '件号', width: 120 },
                 { field: 'PRODUCTNAME', title: '件号名称', width: 150 },
		         { field: 'VERSIONNO', title: '版本号', width: 100 },
		         { field: 'IDENTIFYTYPE', title: '类别', width: 90 }, //--
                 {field: 'KEYIMPTFILELOGO', title: '关重件标识', width: 120 },
                 { field: 'BUILDUNIT', title: '承（主）制单位', width: 90 },
                 { field: 'QPRDLEVEL', title: '级别', width: 70 },
                 { field: 'STATUS', title: '状态', width: 70 },
                 { field: 'HANDLEEMPLOYEENO', title: '分厂控制点处理人员', width: 180 },
                 { field: 'REMARK', title: '备注', width: 250 },
	           ]]
            });

            //分页事件
            $('#pp').pagination({
                onSelectPage: function (pageNumber, pageSize) {
                    customizedEasyuiPagination('pp'); //定制化分页
                    page.pageSize = pageSize; page.pageNumber = pageNumber;
                    page.GetFirstIdentifyProductData();
                }
            });
            //绑定分页go按钮
            $('#pageGo').on("click", function () {
                var pageNumber = $(this).parents('tr').find('.pagination-num').val();
                page.pageNumber = pageNumber;
                page.GetFirstIdentifyProductData();
            });
            //清除按钮
            $('#btnReset').on("click", function () {
                page.reset(true, true);
                page.pageNumber = 1; page.pagetotal = 0
                $('#pp').pagination('refresh', {
                    total: page.pagetotal,
                    pageSize: page.pageSize,
                    pageNumber: page.pageNumber
                });
            });
        },
        //查询
        searchData: function () {
            page.reset(false, true);
            page.pageNumber = 1;
            page.GetFirstIdentifyProductData();
        },
        //查询任务单信息
        GetFirstIdentifyProductData: function () {
            $('#FirstIdentifyProduct').datagrid('loadData', [])
            var frdata = $('#searchForm').serializeArray();
            var data = {};
            $.each(frdata, function () {
                data[this.name] = this.value
            });
            var param = {
                action: "GetFirstIdentifyProductData",
                type: page.pageType,
                pageSize: page.pageSize,
                pageNumber: page.pageNumber,
                data: JSON.stringify([data])
            };
            page.post(param, function (res) {
                if (res.Result) {
                    page.pagetotal = res.RowCount;
                    $('#FirstIdentifyProduct').datagrid('loadData', res.DBTable);
                }
            });
        },
        //解除
        SecureFirstIdentifyProduct: function () {
            var row = $('#FirstIdentifyProduct').datagrid('getChecked');
            if (row.length == 0) { displayMessage('请选择一条数据再进行操作'); return; }
            if (row[0].STATUS == '已解除') { displayMessage('请选择一条【未解除】数据再进行操作'); return; }
            page.post({ action: 'SecureFirstIdentifyProduct', id: row[0].FIRSTIDENTIFYPRODUCTID, type: row[0].FTYPE }, function (res) {
                if (res.Result) { page.GetFirstIdentifyProductData(); }
                displayMessage(res.Message, res.Result);
            });
        },
        //查询重置
        searchReset: function () {
            $('#searchForm').form('clear');
            page.bind();
        },
        //清除方法，重要！！！
        reset: function (iscondition, isresult) {
            clearMessage();
        },
        //post数据
        post: function (param, callback) {
            $.ajax({
                type: "Post",
                url: page.ajaxUrl,
                data: param,
                cashe: false,
                async: true,
                dataType: "json",
                beforeSend: function () {
                    $.messager.progress({ text: '', msg: '处理中...' });
                },
                success: function (data) {
                    $.messager.progress('close');
                    callback(data);
                },
                error: function (XMLHttpRequest, textStatus, errorThrown) {
                    $.messager.progress('close');
                    displayMessage(XMLHttpRequest.responseText, false);
                }
            });
        }
    }
$(function () {
    page.init();
});
</script>
